Skip to content

Conversation

@cacapon
Copy link
Owner

@cacapon cacapon commented May 11, 2025

概要

fixed #110
fdを閉じる処理を追加しました。

対応内容

  • 子プロセスでも対応できるようにt_minishにstdin,stdoutを追加
  • fd閉じているかを確認するためのテスト確認用のシェルを追加
  • exit時にfdをクローズする処理を追加
  • パイプで繋いだ際に閉じていないfdを閉じる処理を追加

確認方法

  • make後に./tests/invoke_cmd/test_fd_closed.shを実行すると現状のminishellで以下をコマンドを実行した場合のfdの開き具合をチェックできます。
    • <Ctrl+D>
    • exit
    • echo "hello" exit
    • ls | cat exit
    • echo 1 | cat | wc exit
  • valgrind --track-fds=yes --trace-children=yes --leak-check=full --show-leak-kinds=all ./minishellで上記以外で気になる入力を打って確認も可能です。

@cacapon cacapon self-assigned this May 11, 2025
@cacapon cacapon added the WIP まだ作業が完了していないプルリクなどに label May 11, 2025
@cacapon cacapon removed the WIP まだ作業が完了していないプルリクなどに label May 12, 2025
@cacapon cacapon marked this pull request as ready for review May 12, 2025 01:03
@cacapon cacapon requested a review from dayano74 May 12, 2025 01:09
@cacapon
Copy link
Owner Author

cacapon commented May 14, 2025

  • エラーパターンも含めexit前に閉じ忘れがないか確認する

Copy link
Collaborator

@dayano74 dayano74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。とても助かります。

@dayano74 dayano74 merged commit 65fd2fc into main May 15, 2025
2 checks passed
@dayano74 dayano74 deleted the feature/110-fix-fd-close branch May 15, 2025 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

エラーでexitする前にfdが閉じられているか、チェックする。

3 participants